/***********************************************************************************************************************************
 * Name:	TestFileAccess.sql
 * Author:	Frank Figearo (frank.figearo@us.bbaaviation.com|frank@sqlnerd.me)
 * Summary:	Test the SQL Server Service's ability to access a folder by doing a simple DIR.
 */
SET IMPLICIT_TRANSACTIONS OFF; IF 0 < @@TRANCOUNT ROLLBACK;
GO
EXEC sp_configure 'show advanced options', 1; RECONFIGURE;
EXEC sp_configure 'xp_cmdshell', 1; RECONFIGURE;
EXECUTE  xp_cmdshell 'DIR \\BBA-Orl-vFS\SQLSecurity$\POS\';
EXEC sp_configure 'xp_cmdshell', 0; RECONFIGURE;
GO